import re

with open(file = "data.txt",mode="r",encoding="utf-8") as file:
    info = file.readlines()

dctLst = []
for index,line in enumerate(info):
    if re.match("^uname",line):
        dct = {}
        line = line.split(" ")
        dct[line[0]] = line[1]
    elif re.match("^upwd",line):
        line = line.split(" ")
        dct[line[0]] = line[1]
    elif re.match("^balance",line):
        line = line.split(" ")
        dct[line[0]] = line[1]
        dctLst.append(dct)

print(dctLst)
    